import React, { lazy, Suspense, } from 'react';

const Lazy = () => {

  const LazyChild = lazy(() => import("./child"));

  const renderLoading = () => {
    return <div>loading ...</div>;
  };

  return (
    <div>
      Lazy
      <Suspense fallback={ renderLoading() }>
        <LazyChild />
      </Suspense>
    </div>
  );
};

export default Lazy;
